﻿using System.Windows;

namespace StockholmsStad.Windows.UI.Modules.Couple.Controls
{
    /// <summary>
    /// Interaction logic for ProtectedIdentityControl.xaml
    /// </summary>
    public partial class ProtectedIdentityControl
    {
        public ProtectedIdentityControl()
        {
            InitializeComponent();

            //SetupBindings();
        }

        //private void SetupBindings()
        //{
        //    var identityContentBinding = new Binding("IsChecked");
        //    identityContentBinding.Source = this;
        //    cbIdentity.SetBinding(System.Windows.Controls.Label.ContentProperty, identityContentBinding);
        //}

        //public static DependencyProperty IsCheckedProperty =
        //    DependencyProperty.Register("IsChecked", typeof(string), typeof(NameValueControl));

        //public bool IsChecked
        //{
        //    get { return (bool)GetValue(IsCheckedProperty); }
        //    set { SetValue(IsCheckedProperty, value); }
        //}

        private void cbIdentity_Checked(object sender, RoutedEventArgs e)
        {
            if (!string.IsNullOrEmpty(tbPerson2BirthdayNumber.Text))
                tbPerson2BirthdayNumber.Text = string.Empty;

            tbPerson2BirthdayNumber.IsEnabled = false;
        }
    }
}
